package com.huaxin.device.dto.enums.typehandler;

import com.huaxin.device.dto.enums.DeviceZoneType;
import com.huaxin.hxenum.base.BaseCodeEnumTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedTypes;

import java.sql.PreparedStatement;
import java.sql.SQLException;

@MappedTypes(DeviceZoneType.class)
public class DeviceZoneTypeHandler extends BaseCodeEnumTypeHandler<DeviceZoneType, String> {
    public DeviceZoneTypeHandler() {
        super(DeviceZoneType.class);
    }

    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, DeviceZoneType parameter, JdbcType jdbcType) throws SQLException {
        ps.setString(i, parameter.getCode());
    }
}
